package com.joven.shelltest.utils.commandmodel;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author wzj
 * @Date 2023-11-07 09:37
 **/
public class Test {

    public static void main(String[] args) {

        //创建server实例
        List<Server> servers = new ArrayList<>();
        servers.add(new ApplicationServer("192.168.1.13"));
        servers.add(new ApplicationServer("192.168.1.14"));
        servers.add(new ApplicationServer("192.168.1.15"));

        //调用者 & 添加命令
        ServerInvoker invoker  = new ServerInvoker();
        invoker.addCommand(new PsCommand(servers));
        invoker.addCommand(new NetCommand(servers));
        invoker.addCommand(new ShutdownCommand(servers));

        //执行命令
        invoker.invoke();
    }
}
